package com.shop.cloud.live.common.feign;

import com.shop.cloud.common.core.constant.SecurityConstants;
import com.shop.cloud.common.core.constant.ServiceNameConstants;
import com.shop.cloud.common.core.feign.entity.FeignPageParam;
import com.shop.cloud.common.core.util.R;
import com.shop.cloud.live.common.entity.LiveRoom;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author
 */
@FeignClient(contextId = "feignLiveRoomService", value = ServiceNameConstants.LIVE_ADMIN_SERVICE)
public interface FeignLiveRoomService {

	/**
	 * 直播间分页列表
	 * @return
	 */
	@PostMapping("/liveroom/inside/page")
	R getPage(@RequestBody FeignPageParam<LiveRoom> params, @RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 直播间查询
	 * @param id
	 * @param from
	 * @return
	 */
	@GetMapping("/liveroom/inside/{id}")
	R getById(@PathVariable("id") String id, @RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 获取指定直播间播流地址
	 * @param id
	 * @param playType
	 * @param from
	 * @return
	 */
	@GetMapping("/liveroom/inside/pullurl/{id}/{playtype}")
	R getPullUrl(@PathVariable("id") String id, @PathVariable("playtype") Integer playType, @RequestHeader(SecurityConstants.FROM) String from);
}
